<!DOCTYPE html>
<html>

<head>
<style type="text/css">
.title
    {
        font-weight: bold;
    }
.elaborateHidden {border:1px solid black; display: none;}
.elaborateShown {border:1px solid black; display: block;}
</style>
<!--
<script src="jquery.min.js" type="text/javascript"></script>
-->
<script type="text/javascript">
  function showhide(divID) {
    var item = document.getElementById(divID);
    if (item) {
      item.className=(item.className=='elaborateHidden')?'elaborateShown':'elaborateHidden';
    }
  }
  
  //~ $(document).ready(function() {
	//~ $("#toc").append('<a class="title">Table of contents:</a><br>')
	//~ $("h1, h2, h3").each(function(i) {
		//~ var current = $(this);
		//~ current.attr("id", "title" + i);
//~ 
		//~ $("#toc").append("<br><a id='link" + i + "' href='#title" + i + "' title='" + current.attr("tagName") + "'>" + current.html() + "</a>");
	//~ });
	//~ });
	//
	//
	// // REGEXP from element search: class (.*)\(.*\):
// replace: <h2><a class="title" name="\1">\1</a>:</h2>\n<p>\n\n</p>\n\n
</script>
</head>




<body>
<!--
<div id="toc"></div>
<i>Index</i>
<a href="#installation">Installation</a>
<a href="#element">Element</a>
<a href="#constitutive">Constitutive</a>
<a href="#body">Body</a>
<a href="#structural_force">Structural force</a>:
<p></p>
-->


<h1><a class="title" name="disclaimer">Disclaimer</a>:</h1>
<p>This manual was written with the intent of giving a quick reference to the suer who is using BAM v2. It does not pretend to be complete. The descriptions given here come from the MBDyn official input manual, the BAM v2 mailing lists, and the available video tutorials.</p>


<h1><a class="title" name="installation">Installation</a>:</h1>
To install BlenderAndMBDyn v2 (BAM) from the Blender interface go to menu <i>File->User Preferences</i> and at the bottom of the panel which appear click the <i>Install from file</i> button.
The procedure is fairly straightfoward but a few details should be taken into consideration:
 <ul style="list-style-type:disc">
  <li>It is recommmended to use Blender 2.72 or newer and a recent MBDyn version;</li>
  <li>Before reinstalling BAM, it should first be uninstalled from Blender which should also be restarted;</li>
  <li>The software is still in development and any bug reports are welcomed on the <a href="https://github.com/gdbaldw/BlenderAndMBDyn";>Github page</a>.</li>
</ul> 

<h1><a class="title" name="tutorials">Video Tutorials</a>:</h1>
The simplest way to learn the basics of the BAM v2 tool is to watch a few of the video tutorials.
The important ones are listed here:
 <ul style="list-style-type:disc">
  <li><a href=https://www.youtube.com/watch?v=TnxtspuR4c0>Crank and slider</a>; construct, simulate, drive through the keyboard while simulating, animate while simulating, and analyze a Crank and Slider model in MBDyn. </li>
  <li><a href=https://www.youtube.com/watch?v=RKprhyOqHZM>Double pendulum</a>; construct, simulate, and analyze a double pendulum. </li>
  <li><a href=https://www.youtube.com/watch?v=EzoHrf-RoUE>Chain</a>; construct, simulate, and analyze a four link chain.</li>
</ul> 


<h1><a class="title" name="element">Elements</a>:</h1>
<p>
The elements section is the basis of the BAM software. You may create an element by clicking on the <img src="createElem.png" alt="+" height="22" /> button and choosing from the list. If you currently have a Blender mesh object selected, it will become that element. Usually, one will start by creating a <a href="#body">Body</a>. Another common element which needs to be inserted is the <a href="#gravity">Gravity</a> element. The <img src="showFiltering.png" alt="+"  height="22" /> button will expand the menu to also show filtering options of the element list. The <img src="editElem.png" alt="inverse triangle"  height="22" /> button will allow one to edit an element or see a list of its users. Double clicking on a name in the list allows to change the said name. In case of a name conflict when creating a new element, a number will be added to the end of the chosen name.
<br><br>

</p>

<h2><a class="title" name="body">Body</a>:</h2>
<p>
A body represents a mass in the multibody model. It requires a mass value, which can be set as a variable name by ticking the checkbox. It also requires a <a href="#3x3">3x3</a> matrix of inertia.
<br><br>
If no Blender mesh object is selected when creating a body, a new one will be created at the location of the cursor. Upon accepting the body creation dialog, the user is invited by the "Object specifications" dialog to modify numerically the position and orientation of the body. This is optional and, in any case, any modifications brough by the user to the associated Blender mesh object will be also applied to the body.
<br><br>
<a href="javascript:showhide('constitutiveDetails');">Click to show/hide elaborate explanation</a>
<div class="elaborateHidden" id="constitutiveDetails">
The body element describes a lumped rigid body connected to a  6 degree of freedom
structural node. The inertia matrix is always referred to the center of mass of the mass that is being added.
</div>
</p>






<h2><a class="title" name="Constitutive">Constitutive</a>:</h2>
<p>

</p>


<h2><a class="title" name="Drive">Drive</a>:</h2>
<p>

</p>


<h2><a class="title" name="Friction">Friction</a>:</h2>
<p>

</p>




<!--
<h2><a class="title" name="Force">Force</a>:</h2>
<p>

</p>
-->


<h2><a class="title" name="structural_force">Structural force</a>:</h2>
<p>
The structural force element allows to apply a force to the selected element. It can be ither absolute or follower. And absolute force will always have the same position and orientation while the follower force will follow the object to which it is applied. The force value is defined by a <a href="#driver">driver</a>.
</p>


<h2><a class="title" name="StructuralInternalForce">StructuralInternalForce</a>:</h2>
<p>

</p>





<h2><a class="title" name="StructuralCouple">StructuralCouple</a>:</h2>
<p>

</p>





<h2><a class="title" name="StructuralInternalCouple">StructuralInternalCouple</a>:</h2>
<p>

</p>





<!--
<h2><a class="title" name="Joint">Joint</a>:</h2>
<p>

</p>
-->


<h2><a class="title" name="Hinge">Hinge</a>:</h2>
<p>

</p>


<h2><a class="title" name="AxialRotation">AxialRotation</a>:</h2>
<p>

</p>


<h2><a class="title" name="clamp">Clamp</a>:</h2>
<p>
The clamp element is used to rigidly fixed a node in space. Use this element to create a solid ground to which moving ovjects may be attached later on.
</p>



<h2><a class="title" name="DeformableDisplacementJoint">DeformableDisplacementJoint</a>:</h2>
<p>
This joint implements a configuration dependent force that is exchanged between two points associated
to two nodes with an offset. The force may depend, by way of a generic 3D constitutive law, on the
relative position and velocity of the two points, expressed in the reference frame of node 1.
The constitutive law is attached to the reference frame of node 1 (TODO: selected last?), so the sequence of the connections
may matter in case of anisotropic constitutive laws, if the relative orientation of the two nodes changes
during the analysis.

</p>





<h2><a class="title" name="DeformableHinge">DeformableHinge</a>:</h2>
<p>

</p>





<h2><a class="title" name="DeformableJoint">DeformableJoint</a>:</h2>
<p>

</p>





<h2><a class="title" name="Distance">Distance</a>:</h2>
<p>

</p>





<h2><a class="title" name="InLine">InLine</a>:</h2>
<p>

</p>





<h2><a class="title" name="InPlane">InPlane</a>:</h2>
<p>

</p>





<h2><a class="title" name="RevoluteHinge">RevoluteHinge</a>:</h2>
<p>

</p>





<h2><a class="title" name="Rod">Rod</a>:</h2>
<p>

</p>





<h2><a class="title" name="spherical_hinge">Spherical Hinge</a>:</h2>
<p>
This joint constrains the relative position of two nodes; the relative orientation is not constrained.
</p>


<!--
<h2><a class="title" name="SphericalHingeOperator">Spherical Hinge Operator</a>:</h2>
<p>
</p>
-->


<h2><a class="title" name="total_joint">Total Joint</a>:</h2>
<p>
The total joint allows to arbitrarily impose constraints between two nodes in the form of user chosen drivers.
</p>





<h2><a class="title" name="ViscousBody">ViscousBody</a>:</h2>
<p>

</p>





<h2><a class="title" name="StreamOutput">StreamOutput</a>:</h2>
<p>

</p>





<h2><a class="title" name="StreamAnimation">StreamAnimation</a>:</h2>
<p>

</p>





<h2><a class="title" name="gravity">Gravity</a>:</h2>
<p>
The Gravity element is used to add a gravity force to the simulation. Many times one will want to define it as a constant drive with a value of 9.81 m/s^2. The gravity element does not get linked with any Blender mesh object. Any type of gravity may be defined by combining the required vector input with a chosen driver.
</p>



<h2><a class="title" name="BodyMass">BodyMass</a>:</h2>
<p>

</p>





<h2><a class="title" name="RigidOffset">RigidOffset</a>:</h2>
<p>

</p>





<h2><a class="title" name="DummyNode">DummyNode</a>:</h2>
<p>
The dummy structural node has been added to ease the visualization of the kinematics of arbitrary points
of the system during the simulation. It does not provide any degrees of freedom, and it must be attached
to another node.

</p>





<h2><a class="title" name="BeamSegment">BeamSegment</a>:</h2>
<p>

</p>





<h1><a class="title" name="constitutive">Constitutives</a>:</h1>
<p>
</p>

<!--
<h1><a class="title" name="drive">Drives</a>:</h1>
<p>
</p>

<h1><a class="title" name="driver">Drivers</a>:</h1>
<p>
</p>
-->


<h2><a class="title" name="file_drive">file drive</a>:</h2>
<p>
The file format is<br>
# an arbitrary number of comment lines starting with '#'<br>
#<br>
# comment lines may provide special parameters<br>
# like "initial time", "time step" as indicated above; for example<br>
#<br>
# initial time: 0<br>
# time step: 0.01<br>
#<br>
# channel #1 channel #2 ... channel #n<br>
1.     2. ... 100.<br>
...<br>
Example.<br>
begin: drivers;<br>
file: 100,<br>
fixed step,<br>
100, # n. steps<br>
1, # n. channels<br>
0, # initial_time<br>
0.01, # time_step<br>
"input.dat";<br>
file: 200,<br>
fixed step,<br>
count, # n. steps<br>
1, # n. channels<br>
from file, # initial_time<br>
from file, # time_step<br>
"input.dat";<br>
end: drivers;

</p>


<h1><a class="title" name="input_card">Input card</a></h1>
<p>
This panel allows to create new variables by name. These may then be used throughout the model.
<br><br>
<a href="javascript:showhide('input_cardDetails');">Click to show/hide elaborate explanation</a>
<div class="elaborateHidden" id="input_cardDetails">
The user is encouraged to use such variables to simplify the creation of the model. A typical example would be to define variables of mass, length, height, and depth of a body to then be able to easily change later on the properties of that body. The values can be changed without having to manually edit all the matrices associated to that body. It becomes even more useful when one would want to scale a complete model by a factor. Mathematical operations can be done to create new variables from previously defined ones.
</div>
</p>

<h1><a class="title" name="friction">Frictions</a>:</h1>
<p>
</p>

<h1><a class="title" name="function">Functions</a>:</h1>
<p>
</p>




<h1><a class="title" name="matrix">Matrices</a>:</h1>
<p>
</p>

<h2><a class="title" name="3x1">3x1 Matrix</a>:</h2>
<p>
</p>
	
<h2><a class="title" name="3x3">3x3 Matrix</a>:</h2>
<p>
</p>

<h1><a class="title" name="shape">Shapes</a>:</h1>
<p>
</p>

<h1><a class="title" name="definition">Definitions</a>:</h1>
<p>
</p>

<h1><a class="title" name="simulator">Simulator</a>:</h1>
<p>
	This tab allows to create a new simulator/simulation. Only one simulation needs to be created. It can be ran multiple times. After having updated the multibody model, one can simply select the desired simulator and click the <i>Run simulation</i> button followed by the <i>Animated objects</i> button to see the new updated results.
	
<br><br><img src="info.svg" alt="i:" height="44" />	It is recommended to initially chose a high value of <i>steps between objects</i> when importing the animated results because MBDyn typically has a large number of timesteps and importing all of them in Blender may take a long time.
	<br><br>
<a href="javascript:showhide('simulatorDetails');">Click to show/hide elaborate explanation</a>
<div class="elaborateHidden" id="simulatorDetails">
In the panel which ...
</div>
</p>

<h2><a class="title" name="initial_value">Initial Value</a>:</h2>
<p>
	This panel allows to set the core preferences of MBDyn and the multibody simulation. By ticking the <i>MBDyn path</i> box, one will be able to give the path to the MBDyn executable to be used. 
	
	The <i>General_data</i>, <i>Output_data</i>, and <i>job_control</i> allow to impose settings in a similar fashion as explained in the MBDyn manual. <b>TODO: insert link to manual ?</b>
	
	The <i>default_output</i> drop-down menu selector allows to create a set of output values that ought to be printed to the output files when the simulation is ran.
	<br><br>
<a href="javascript:showhide('initial_valueDetails');">Click to show/hide elaborate explanation</a>
<div class="elaborateHidden" id="initial_valueDetails">
...
</div>
</p>




<h1><a class="title" name="constitutive">Constitutive law</a>:</h1>
<p>
This panel allows to define the laws used by the deformable joints.
<br><br>
<a href="javascript:showhide('constitutiveDetails');">Click to show/hide elaborate explanation</a>
<div class="elaborateHidden" id="constitutiveDetails">
Every time a &quot;deformable&quot;
entity requires a constitutive law, a template constitutive law is read.
The &quot;deformable&quot; elements at present are:<br>
- rod and genel spring and related elements (1D);<br>
- deformable hinge and deformable displacement joint elements (3D);<br>
- deformable joint and beam elements (6D).<br>
Constitutive laws are also used in non-structural components, to allow some degree of generality in
defining input/output relationships. Some constitutive laws are meaningful only when related to some
precise dimensionality. In some special cases, general purpose (genel) elements use 1D constitutive laws
to express an arbitrary dependence of some value on a scalar state of the system. Table 2.7 shows the
availability of each constitutive law.<br>
The meaning of the input and output parameters of a constitutive law is dictated by the entity that
uses it. In general, the user should refer to the element the constitutive law is being instantiated for in
order to understand what the input and the output parameters are supposed to be.
</div>
</p>


</body>
</html>

